// 一个原型对象
const prototype = {
  getName() {
    return this.first + " " + this.last;
  },
  say() {
    alert("hello");
  },
};

// 基于原型创建 x
let x = Object.create(prototype);
x.first = "A";
x.last = "B";
alert(x.getName());
x.say();

// 基于原型创建 y
let y = Object.create(prototype);
y.first = "C";
y.last = "D";
alert(y.getName());
y.say();
